package com.example.project.mapper;

import com.example.project.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {
    //根据用户名查询
    @Select("select * from user where username=#{username}")
    User findbyusername(String username);

    //添加
    @Insert("insert into user(username,password,name)values(#{username},#{password},#{name})")
    void add(String username, String password, String name);

     @Update("update user set password=#{newpwd} where id=#{id} ")
    void updatePwd(String newpwd, Integer id);
}
